﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Data.Common;

namespace Jin.Core.Linq.Structure
{
   public   class QueryCommand<T>
    {
       public string CommandText { get; private set; }
       public List<string> ColumnNames = new List<string>();
       public ReadOnlyCollection<string> ParamterNames { get; private set; }
       public Func<DbDataReader, T> Projector { get; private set; }
       /// <summary>
        /// ColumnNames添加到项目的支持
       /// </summary>
       /// <param name="commandText"></param>
       /// <param name="paramNames"></param>
       /// <param name="projector"></param>
       /// <param name="ColumnNames"></param>
       public QueryCommand(string commandText,IEnumerable<string> paramNames,Func<DbDataReader,T> projector,List<string> ColumnNames)
       {
           CommandText = commandText;
           ParamterNames = new List<string>(paramNames).AsReadOnly();
           Projector = projector;
           this.ColumnNames = ColumnNames;
       }
    }
}
